Termination of the following Term Rewriting System could be proven:

Context-sensitive rewrite system:
The TRS R consists of the following rules:

first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, first(X, Z))
from(X) → cons(X, from(s(X)))

The replacement map contains the following entries:

first: {1, 2}
0: empty set
nil: empty set
s: {1}
cons: {1}
from: {1}


CSR
  ↳ CSRInnermostProof

Context-sensitive rewrite system:
The TRS R consists of the following rules:

first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, first(X, Z))
from(X) → cons(X, from(s(X)))

The replacement map contains the following entries:

first: {1, 2}
0: empty set
nil: empty set
s: {1}
cons: {1}
from: {1}

The CSR is orthogonal. By [10] we can switch to innermost.

↳ CSR
  ↳ CSRInnermostProof
CSR
      ↳ CSDependencyPairsProof

Context-sensitive rewrite system:
The TRS R consists of the following rules:

first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, first(X, Z))
from(X) → cons(X, from(s(X)))

The replacement map contains the following entries:

first: {1, 2}
0: empty set
nil: empty set
s: {1}
cons: {1}
from: {1}

Innermost Strategy.

Using Improved CS-DPs we result in the following initial Q-CSDP problem.

↳ CSR
  ↳ CSRInnermostProof
    ↳ CSR
      ↳ CSDependencyPairsProof
QCSDP
          ↳ QCSDependencyGraphProof

Q-restricted context-sensitive dependency pair problem:
The symbols in {first, s, from, FIRST, FROM} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.
The symbols in {U} are not replacing on any position.


The hidden terms of R are:

first(X, Z)
from(s(X))

Every hiding context is built from:

first on positions {1, 2}
s on positions {1}
from on positions {1}

Hence, the new unhiding pairs DPu are :

U(first(x_0, x_1)) → U(x_0)
U(first(x_0, x_1)) → U(x_1)
U(s(x_0)) → U(x_0)
U(from(x_0)) → U(x_0)
U(first(X, Z)) → FIRST(X, Z)
U(from(s(X))) → FROM(s(X))

The TRS R consists of the following rules:

first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, first(X, Z))
from(X) → cons(X, from(s(X)))

The set Q consists of the following terms:

first(0, x0)
first(s(x0), cons(x1, x2))
from(x0)


The approximation of the Context-Sensitive Dependency Graph contains 1 SCC with 2 less nodes.


↳ CSR
  ↳ CSRInnermostProof
    ↳ CSR
      ↳ CSDependencyPairsProof
        ↳ QCSDP
          ↳ QCSDependencyGraphProof
QCSDP
              ↳ QCSDPSubtermProof

Q-restricted context-sensitive dependency pair problem:
The symbols in {first, s, from} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.
The symbols in {U} are not replacing on any position.

The TRS P consists of the following rules:

U(first(x_0, x_1)) → U(x_0)
U(first(x_0, x_1)) → U(x_1)
U(s(x_0)) → U(x_0)
U(from(x_0)) → U(x_0)

The TRS R consists of the following rules:

first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, first(X, Z))
from(X) → cons(X, from(s(X)))

The set Q consists of the following terms:

first(0, x0)
first(s(x0), cons(x1, x2))
from(x0)


We use the subterm processor [20].


The following pairs can be oriented strictly and are deleted.


U(first(x_0, x_1)) → U(x_0)
U(first(x_0, x_1)) → U(x_1)
U(s(x_0)) → U(x_0)
U(from(x_0)) → U(x_0)
The remaining pairs can at least be oriented weakly.
none
Used ordering: Combined order from the following AFS and order.
U(x1)  =  x1

Subterm Order


↳ CSR
  ↳ CSRInnermostProof
    ↳ CSR
      ↳ CSDependencyPairsProof
        ↳ QCSDP
          ↳ QCSDependencyGraphProof
            ↳ QCSDP
              ↳ QCSDPSubtermProof
QCSDP
                  ↳ PIsEmptyProof

Q-restricted context-sensitive dependency pair problem:
The symbols in {first, s, from} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.

The TRS P consists of the following rules:
none

The TRS R consists of the following rules:

first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, first(X, Z))
from(X) → cons(X, from(s(X)))

The set Q consists of the following terms:

first(0, x0)
first(s(x0), cons(x1, x2))
from(x0)


The TRS P is empty. Hence, there is no (P,Q,R,µ)-chain.